package me.keiwu.user.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Created by kei on 18/05/2017.
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = false)
@Table(uniqueConstraints = {
        @UniqueConstraint(name = "uidx_openId", columnNames = "openId")
})
public class User extends AbstractBaseEntity {

    @Id
    @GeneratedValue
    private Long id;

    @ColumnDefault(value = "0")
    private Integer gold = 60;

    @Column(length = 65)
    private String unionId;

    @Column(length = 65)
    private String openId;

    @Column(length = 100)
    private String nickName;

    @Column(length = 200)
    private String avatarUrl;

    @Column(length = 200)
    private String wxAvatarUrl;

    @Column(columnDefinition = "TINYINT", length = 1)
    private Integer gender = 0;

    @Column(length = 40)
    private String city;

    @Column(length = 150)
    private String lbsCityName;

    @Column(length = 40)
    private String province;

    @Column(length = 40)
    private String country;

    @Column(length = 20)
    private String telephone;

    private String channel;

    private Integer level;

}
